<include file="Public/header" />
<title></title>
</head>
<style type="text/css">
    .table span{
        display: block;
        float: left;
        margin-right: 12px;;
    }
    .a_table{
        padding-left: 24px;
    }

</style>
<body>
<div class="page-container">
    <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper no-footer">
            <table class="table table-border table-bordered table-bg table-hover table-sort dataTable no-footer" id="DataTables_Table_0" role="grid" aria-describedby="DataTables_Table_0_info">
            <thead>
            <tr class="text-c" role="row">
                <th width="25" style="width: 25px;">
					<input type="checkbox" name="" value="">
				</th>
                <th width="80" style="width: 80px;">ID</th>
                <th width="120">商品编码</th>
                <th width="120" style="width: 180px;">商品名称</th>
				<th width="120" style="width: 120px;">总库存</th>
                <th width="120" style="width: 120px;">剩余库存</th>
				<th width="120" style="width: 120px;">预警库存</th>
				<th width="120" style="width: 120px;">添加时间</th>
				<th width="120" style="width: 120px;">操作</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="list" key="i" item="data">
            <tr class="text-c odd" role="row">
                <td><input type="checkbox" value="<{$data.id}>" name=""></td>
                <td><{$i+1}></td>
                <td><{$data.goods_no}></td>
                <td><{$data.goods_name}></td>
				<td><{$data.storage_amount}></td>
				<td><{$data.storage_amount_config}></td>
				<td><{$data.storage_alert_amount_config}></td>
				<td><{$data.add_time|date="Y-m-d",###}></td>
                <td class="f-14 td-manage">
                    <a style="text-decoration:none" class="ml-5" onclick="edit('<{$data.id}>')" href="javascript:;" title="编辑">编辑</a>
                </td>
            </tr>
            </foreach>
            </tbody>
        </table>
		<div class="page mt" style="text-align:right"><{$page}></div>
    </div>
</div>
<include file="Public/footer_js" />
<script>
	function edit(id){
		if(isNaN(id)){
			layer.msg('操作有误');
			return false;
		}
		layer.prompt({title: '请输入该商品的预警库存', formType: 0}, function(text, index){
			if(isNaN(text)){
				layer.msg('操作有误');
				return false;
			}
			$.post('__CONTROLLER__/storage_config_department_editD',{
				id:id,
				count:text,
			},function (msg){
				layer.msg(msg.data);
				if(msg.flag==1){
					setTimeout(function (){
						location.reload();
					},800);
				}
			},'json');
		});
	}
	
    function cancel(){
        parent.layer.closeAll();
    }
</script>
</body>
</html>